home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_MacPaint / Source / Extractors / extractor.r < prev    next >
Text File  |  1995-06-12  |  10KB  |  267 lines

  1. /***********************************************************************\
  2. Extract {PICT|FONT}, applications to extract Mac resources to separate files
  3. Copyright (C) 1993 David John Burrowes
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  10.  
  11. The author, David John Burrowes, can be reached at:
  12.     davidjohn@kira.net.netcom.com
  13.     David John Burrowes
  14.     1926 Ivy #10
  15.     San Mateo, CA 94403-1367
  16. \***********************************************************************/
  17.  
  18.  
  19. /******************************************************************
  20.     
  21.     Beginning.r
  22.     
  23.     Heavily modified from a TML pascal example
  24.     
  25. \*****************************************************************/
  26.  
  27. #include "SysTypes.r"
  28. #include "Types.r"
  29.  
  30. resource 'vers' (1) {
  31.     0x01, 0x01, release, 0x01,
  32.     verUS,
  33.     "1.0",
  34.     "1.0, Written in Jan 1993 by David John Burrowes."
  35. };
  36.  
  37.  
  38. /* Size resources */
  39.  
  40. /* I AM SURE THESE ARE BAD!!!!!!!!!!!! */
  41.  
  42. resource 'SIZE' (-1) {
  43.     saveScreen,
  44.     ignoreSuspendResumeEvents,
  45.     enableOptionSwitch,
  46.     canBackground,
  47.     notMultiFinderAware,
  48.     backgroundAndForeground,
  49.     dontGetFrontClicks,
  50.     ignoreChildDiedEvents,
  51.     not32BitCompatible,
  52.     reserved,
  53.     reserved,
  54.     reserved,
  55.     reserved,
  56.     reserved,
  57.     reserved,
  58.     reserved,
  59.     256 * 1024,
  60.     512 * 1024
  61. };
  62.  
  63.  
  64.  
  65. resource 'BNDL' (128) {
  66.     'ExRS',
  67.     0,
  68.     {    /* array TypeArray: 2 elements */
  69.         /* [1] */
  70.         'FREF',
  71.         {    /* array IDArray: 1 elements */
  72.             /* [1] */
  73.             0, 128
  74.         },
  75.         /* [2] */
  76.         'ICN#',
  77.         {    /* array IDArray: 1 elements */
  78.             /* [1] */
  79.             0, 128
  80.         }
  81.     }
  82. };
  83.  
  84. data 'FREF' (128) {
  85.     $"4150 504C 0000 7F"                                  /* APPL... */
  86. };
  87.  
  88. resource 'ICN#' (128) {
  89.     {    /* array: 2 elements */
  90.         /* [1] */
  91.         $"0001 0000 0002 0000 EAF8 8BA6 8A55 5555"
  92.         $"C459 D156 8A55 5555 EA55 4925 0080 0200"
  93.         $"0100 0100 0200 0080 0400 0040 0800 0020"
  94.         $"1000 0010 2000 0008 4000 3F04 8000 7F82"
  95.         $"4000 FFC1 2001 FFE2 1001 CFF4 080F 807D"
  96.         $"0403 EFFA 0201 FFFD 0100 FFFA 0080 7FFD"
  97.         $"0040 1FFA 0020 021D 0010 0402 0008 0800"
  98.         $"0004 1000 0002 2000 0001 4000 0000 80",
  99.         /* [2] */
  100.         $"0001 0000 0003 8000 EAFF CBA6 8A5F F577"
  101.         $"C45F F176 8A7F F175 EA7F F525 00FF FE00"
  102.         $"01FF FF00 03FF FF80 07FF FFC0 0FFF FFE0"
  103.         $"1FFF FFF0 3FFF FFF8 7FFF FFFC FFFF FFFE"
  104.         $"7FFF FFFF 3FFF FFFE 1FFF FFFC 0FFF FFFF"
  105.         $"07FF FFFF 03FF FFFF 01FF FFFF 00FF FFFF"
  106.         $"007F FFFF 003F FE1F 001F FC07 000F F800"
  107.         $"0007 F000 0003 E000 0001 C000 0000 80"
  108.     }
  109. };
  110.  
  111. data 'ExRS' (0, "Owner resource") {
  112.     $"00"                                                 /* . */
  113. };
  114.  
  115. data 'TEXT' (128) {
  116.     $"4578 7472 6163 7420 464F 4E54 2C20 6973"            /* Extract FONT, is */
  117.     $"2061 2071 7569 636B 2026 2064 6972 7479"            /*  a quick & dirty */
  118.     $"2075 7469 6C69 7479 2077 6974 6820 6F6E"            /*  utility with on */
  119.     $"6520 7075 7270 6F73 653A 2074 6F20 6578"            /* e purpose: to ex */
  120.     $"7472 6163 7420 636F 7069 6573 206F 6620"            /* tract copies of  */
  121.     $"7468 6520 666F 6E74 7320 2874 7970 6573"            /* the fonts (types */
  122.     $"2046 4F4E 5420 2620 4E46 4E54 2920 6672"            /*  FONT & NFNT) fr */
  123.     $"6F6D 2061 2066 696C 652C 2061 6E64 2073"            /* om a file, and s */
  124.     $"746F 7265 2074 6865 6D20 696E 2073 6570"            /* tore them in sep */
  125.     $"6172 6174 6520 6E65 7720 6669 6C65 7320"            /* arate new files  */
  126.     $"666F 7220 436F 6E76 6572 7420 464F 4E54"            /* for Convert FONT */
  127.     $"2C20 6F6E 2079 6F75 7220 4E65 5854 2C20"            /* , on your NeXT,  */
  128.     $"746F 206C 6174 6572 2070 726F 6365 7373"            /* to later process */
  129.     $"2E0D 0D54 6F20 5573 653A 2043 686F 6F73"            /* .´´To Use: Choos */
  130.     $"6520 4F70 656E 2E2E 2E20 6672 6F6D 2074"            /* e Open... from t */
  131.     $"6865 2046 696C 6520 6D65 6E75 2061 6E64"            /* he File menu and */
  132.     $"2073 656C 6563 7420 6120 6669 6C65 206E"            /*  select a file n */
  133.     $"616D 652E 2020 416C 6C20 7468 6520 666F"            /* ame.  All the fo */
  134.     $"6E74 7320 696E 2074 6861 7420 6669 6C65"            /* nts in that file */
  135.     $"2077 696C 6C20 7468 656E 2062 6520 6578"            /*  will then be ex */
  136.     $"7472 6163 7465 642E 2054 7261 6E73 6665"            /* tracted. Transfe */
  137.     $"7220 7468 6520 6578 7472 6163 7465 6420"            /* r the extracted  */
  138.     $"6669 6C65 7309 2861 7320 6269 6E61 7279"            /* files˘(as binary */
  139.     $"2066 696C 6573 2920 746F 2079 6F75 7220"            /*  files) to your  */
  140.     $"4E65 5854 2C20 616E 6420 7468 656E 2070"            /* NeXT, and then p */
  141.     $"726F 6365 7373 2074 6865 6D20 7769 7468"            /* rocess them with */
  142.     $"2043 6F6E 7665 7274 2046 4F4E 542E 0D0D"            /*  Convert FONT.´´ */
  143.     $"5365 6520 7468 6520 436F 6E76 6572 7420"            /* See the Convert  */
  144.     $"464F 4E54 2068 656C 7020 7769 6E64 6F77"            /* FONT help window */
  145.     $"2066 6F72 206D 6F72 6520 696E 666F 2E0D"            /*  for more info.´ */
  146.     $"0D5C 4461 7669 6420 4A6F 686E 2042 7572"            /* ´\David John Bur */
  147.     $"726F 7765 730D 6465 6174 6840 6B69 7261"            /* rowes´death@kira */
  148.     $"2E6E 6574 2E6E 6574 636F 6D2E 636F 6D00"            /* .net.netcom.com. */
  149. };
  150.  
  151. data 'TEXT' (129) {
  152.     $"4578 7472 6163 7420 5049 4354 2C20 6973"            /* Extract PICT, is */
  153.     $"2061 2071 7569 636B 2026 2064 6972 7479"            /*  a quick & dirty */
  154.     $"2075 7469 6C69 7479 2077 6974 6820 6F6E"            /*  utility with on */
  155.     $"6520 7075 7270 6F73 653A 2074 6F20 6578"            /* e purpose: to ex */
  156.     $"7472 6163 7420 636F 7069 6573 206F 6620"            /* tract copies of  */
  157.     $"7468 6520 696D 6167 6573 2028 7479 7065"            /* the images (type */
  158.     $"2050 4943 5429 2066 726F 6D20 6120 6669"            /*  PICT) from a fi */
  159.     $"6C65 2C20 616E 6420 7374 6F72 6520 7468"            /* le, and store th */
  160.     $"656D 2069 6E20 7365 7061 7261 7465 206E"            /* em in separate n */
  161.     $"6577 2066 696C 6573 2066 6F72 2043 6F6E"            /* ew files for Con */
  162.     $"7665 7274 2050 4943 542C 206F 6E20 796F"            /* vert PICT, on yo */
  163.     $"7572 204E 6558 542C 2074 6F20 6C61 7465"            /* ur NeXT, to late */
  164.     $"7220 7072 6F63 6573 7320 286F 7220 666F"            /* r process (or fo */
  165.     $"7220 7573 6520 696E 2079 6F75 7220 6661"            /* r use in your fa */
  166.     $"766F 7269 7465 2064 7261 7720 7072 6F67"            /* vorite draw prog */
  167.     $"7261 6D21 292E 0D0D 546F 2055 7365 3A20"            /* ram!).´´To Use:  */
  168.     $"4368 6F6F 7365 204F 7065 6E2E 2E2E 2066"            /* Choose Open... f */
  169.     $"726F 6D20 7468 6520 4669 6C65 206D 656E"            /* rom the File men */
  170.     $"7520 616E 6420 7365 6C65 6374 2061 2066"            /* u and select a f */
  171.     $"696C 6520 6E61 6D65 2E20 2041 6C6C 2074"            /* ile name.  All t */
  172.     $"6865 2050 4943 5473 2069 6E20 7468 6174"            /* he PICTs in that */
  173.     $"2066 696C 6520 7769 6C6C 2074 6865 6E20"            /*  file will then  */
  174.     $"6265 2065 7874 7261 6374 6564 2E20 5472"            /* be extracted. Tr */
  175.     $"616E 7366 6572 2074 6865 2065 7874 7261"            /* ansfer the extra */
  176.     $"6374 6564 2066 696C 6573 0928 6173 2062"            /* cted files˘(as b */
  177.     $"696E 6172 7920 6669 6C65 7329 2074 6F20"            /* inary files) to  */
  178.     $"796F 7572 204E 6558 542C 2061 6E64 2074"            /* your NeXT, and t */
  179.     $"6865 6E20 7072 6F63 6573 7320 7468 656D"            /* hen process them */
  180.     $"2077 6974 6820 436F 6E76 6572 7420 5049"            /*  with Convert PI */
  181.     $"4354 2E0D 0D53 6565 2074 6865 2043 6F6E"            /* CT.´´See the Con */
  182.     $"7665 7274 2050 4943 5420 6865 6C70 2077"            /* vert PICT help w */
  183.     $"696E 646F 7720 666F 7220 6D6F 7265 2069"            /* indow for more i */
  184.     $"6E66 6F2E 0D0D 5C44 6176 6964 204A 6F68"            /* nfo.´´\David Joh */
  185.     $"6E20 4275 7272 6F77 6573 0D64 6561 7468"            /* n Burrowes´death */
  186.     $"406B 6972 612E 6E65 742E 6E65 7463 6F6D"            /* @kira.net.netcom */
  187.     $"2E63 6F6D 00"                                       /* .com. */
  188. };
  189.  
  190. resource 'MBAR' (128) {
  191.     {    /* array MenuArray: 2 elements */
  192.         /* [1] */
  193.         128,
  194.         /* [2] */
  195.         129
  196.     }
  197. };
  198.  
  199. resource 'MENU' (128) {
  200.     128,
  201.     textMenuProc,
  202.     0x7FFFFFE0,
  203.     enabled,
  204.     apple,
  205.     {    /* array: 5 elements */
  206.         /* [1] */
  207.         "A simple hacky utility", noIcon, noKey, noMark, plain,
  208.         /* [2] */
  209.         "by David John Burrowes", noIcon, noKey, noMark, plain,
  210.         /* [3] */
  211.         "January 1993", noIcon, noKey, noMark, plain,
  212.         /* [4] */
  213.         "-", noIcon, noKey, noMark, plain,
  214.         /* [5] */
  215.         "Its such a hack, it doesn't do DAs", noIcon, noKey, noMark, plain
  216.     }
  217. };
  218.  
  219. resource 'MENU' (129) {
  220.     129,
  221.     textMenuProc,
  222.     0x7FFFFFFD,
  223.     enabled,
  224.     "File",
  225.     {    /* array: 3 elements */
  226.         /* [1] */
  227.         "Open...", noIcon, "O", noMark, plain,
  228.         /* [2] */
  229.         "-", noIcon, noKey, noMark, plain,
  230.         /* [3] */
  231.         "Quit", noIcon, "Q", noMark, plain
  232.     }
  233. };
  234.  
  235. resource 'ALRT' (128, locked, preload) {
  236.     {58, 56, 144, 384},
  237.     128,
  238.     {    /* array: 4 elements */
  239.         /* [1] */
  240.         OK, visible, sound1,
  241.         /* [2] */
  242.         OK, visible, sound1,
  243.         /* [3] */
  244.         OK, visible, sound1,
  245.         /* [4] */
  246.         OK, visible, sound1
  247.     }
  248. };
  249.  
  250. resource 'DITL' (128, locked, preload) {
  251.     {    /* array DITLarray: 2 elements */
  252.         /* [1] */
  253.         {60, 254, 80, 314},
  254.         Button {
  255.             enabled,
  256.             "Oh"
  257.         },
  258.         /* [2] */
  259.         {8, 62, 52, 319},
  260.         StaticText {
  261.             disabled,
  262.             "^0"
  263.         }
  264.     }
  265. };
  266.  
  267.